#ifndef __GlText_h__
#define __GlText_h__

#include <vector>
#include "GlMain.h"
#include "GlPosition.h"
#include "GlSize.h"

namespace GraphicLibrary
{
	class Position;
	class Sprite;
	class GlExport Text
	{
		public:
			Text(const char *fontName);
			Text(const char *fontName, const char *text);
			virtual ~Text();
			inline Position getPosition() const	{return mPos;}
			inline float getX() const			{return getPosition().mX;}
			inline float getY() const			{return getPosition().mY;}
			inline const char* getText() const	{return mText;}
			inline bool isVisible() const		{return mVisibility;}
			inline float getLayer() const		{return mLayer;}
			inline Size getScale() const		{return mScale;}
			void move(const Position &pos);
			void setText(const char* text);
			bool contains(const Position &pos) const;
			void setVisibility(const bool visible);
			void setLayer(const float layer);
			void setScale(const Size &newScale);
		private:
			typedef std::vector<Sprite*>	SpriteArray;
			const char*	mFontName;
			char*		mText;
			bool		mVisibility;
			SpriteArray	mSprites;
			Position	mPos;
			Size		mBoundingBox;
			float		mLayer;
			Size		mScale;

			void createSprites();
			void destroySprites();
			void moveSprites();
			static char* InitText(const char *text);
	};
}

#endif // __GlText_h__
